/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package quanlynhatre.Model;

import java.util.Date;

/**
 *
 * @author VOTHUY
 */
public class TrangThai {
    
    private Date NgayVaoLam;
    private boolean TT;
    private String TTGV;
    private String LoaiHD;
 
// Khoi tao
public TrangThai() {
    }
public TrangThai New()
{
    TrangThai tt = new TrangThai();
    tt.TT = false;
    tt.TTGV = "";
    tt.LoaiHD = "";
    return tt;
}

public TrangThai(Date ngayvl,boolean ttgv, String loaihd) {
        this.NgayVaoLam = ngayvl;
        this.TT = ttgv;
        this.LoaiHD = loaihd;
    }
// Ham get, set
public Date getNgayVaoLam() {
        return NgayVaoLam;
    }
public boolean setNgayVaoLam(Date value) {
        if ( value.toString().length()== 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Ngay vao lam khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        
        else
        {
            this.NgayVaoLam = value;
            return true;
        }
        return false;       
}  
       
public boolean getTT() {
        return TT;
    }
public void setTT(boolean ttgv) {
        this.TT = ttgv;       
}  
public String getLoaiHD() {
        return LoaiHD;
    }
public boolean setLoaihd(String value) {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Loai HD khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "Loai HD khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.LoaiHD = value;
            return true;
        }
        return false;       
    }

public String getTTGV() {
        return TTGV;
    }
public boolean setTTGV(String value) {
        if ( value.length() == 0 )
            javax.swing.JOptionPane.showMessageDialog(null, "Gia tri khong duoc phep de trong","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else if ( value.length() > 50 )
            javax.swing.JOptionPane.showMessageDialog(null, "Gia tri khong duoc phep lon hon 50 ky tu","Error", javax.swing.JOptionPane.WARNING_MESSAGE);
        else
        {
            this.TTGV = value;
            return true;
        }
        return false;       
    }
    
}
